﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GraphTools.OSM
{
    public class OSMBase
    {
        public static int NextID {get; protected set;}

        public int ID { get; protected set; }
        public int Version { get; protected set; }
        public DateTime Timestamp { get; protected set; }
        public IDictionary<string, string> Tags { get; set; }

        public OSMBase(int ID, int Version, DateTime Timestamp, IDictionary<string, string> Tags)
        {
            this.ID = ID;
            this.Version = Version;
            this.Timestamp = Timestamp;
            this.Tags = Tags;
        }

        public OSMBase()
        {
            this.ID = GetNextID();
            this.Version = 1;
            this.Timestamp = DateTime.Now;
            this.Tags = new Dictionary<string, string>(0);
        }

        public static int GetNextID(){
            return NextID++;
        }

        public static void SetNextID(int value)
        {
            NextID = value;
        }

    }
}
